package com.securitytrace.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 
 * rfid电子标签实体类
 *
 */
@Entity
@Table(name="rfid")
public class RFID implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3065226958779050791L;
	
	@Id
	private String id;
	
	@OneToOne
	private AntiFakeCode antiFakeCode;

	@OneToOne
	private Product product;
	
	@ManyToOne
	private RFID parent;
	
	@OneToMany(mappedBy="rfid",targetEntity=RfidRecordedInfo.class)
	private Set<RfidRecordedInfo> recordedInfoSet;
	
	public void setAntiFakeCode(AntiFakeCode antiFakeCode) {
		this.antiFakeCode = antiFakeCode;
	}
	public AntiFakeCode getAntiFakeCode() {
		return antiFakeCode;
	}


	public void setRecordedInfoSet(Set<RfidRecordedInfo> recordedInfoSet) {
		this.recordedInfoSet = recordedInfoSet;
	}
	public Set<RfidRecordedInfo> getRecordedInfoSet() {
		return recordedInfoSet;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public Product getProduct() {
		return product;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getId() {
		return id;
	}
	public RFID getParent() {
		return parent;
	}
	public void setParent(RFID parent) {
		this.parent = parent;
	}
}
